using System.Drawing;
using dk.Helper.Base;
using dk.Helper.Base.Core;
using NUnit.Framework;

namespace dk.Helper.Test
{
    [TestFixture]
    public class VillageGroupTest
    {
        private const string GROUP_NAME = "Group Name";
        private IVillageGroup villageGroup;
        private IGroupType groupType;
        private IVillage dummyVillage;

        [SetUp]
        public void SetUp()
        {
            groupType = new GroupType();
            villageGroup = new VillageGroup(GROUP_NAME, groupType);
            dummyVillage = new Village(0, string.Empty, new Point(0, 0), 0, 0, 0);
        }

        [Test]
        public void Villages_InitialState_NotNull()
        {
            Assert.IsNotNull(villageGroup.Villages);
        }

        [Test]
        public void GroupType_InitialState_NotNull()
        {
            Assert.IsNotNull(villageGroup.GroupType);
        }

        [Test]
        public void AddVillage()
        {
            villageGroup.AddVillage(dummyVillage);
            Assert.IsTrue(villageGroup.Contains(dummyVillage));
        }

        [Test]
        public void RemoveVillage()
        {
            villageGroup.Villages.Add(dummyVillage);
            villageGroup.RemoveVillage(dummyVillage);
            Assert.IsFalse(villageGroup.Contains(dummyVillage));
        }

        [Test]
        public void ContainsTrue()
        {
            villageGroup.Villages.Add(dummyVillage);
            Assert.IsTrue(villageGroup.Contains(dummyVillage));
        }

        [Test]
        public void ContainsFalse()
        {
            Assert.IsFalse(villageGroup.Contains(dummyVillage));
        }

        [Test]
        public void Name()
        {
            villageGroup.Name = GROUP_NAME;
            Assert.AreEqual(GROUP_NAME, villageGroup.Name);
        }
    }
}
